package cn.niit.letuseatdemo.exception;


import cn.niit.letuseatdemo.common.enums.ExceptionCodeEnum;
import lombok.Getter;

/**
 * @Description:
 * @Author: yang_yong
 * @CreateTime： 2022/11/9 23:49
 */
public class LetuseatException extends RuntimeException {

    @Getter
    private String code;

    public LetuseatException(String message) {
        super(message);
        this.code = ExceptionCodeEnum.IBEACON_COMMON_ERROR.getResCode();
    }

    public LetuseatException(String code, Throwable throwable) {
        super(throwable);
        this.code = code;
    }

    public LetuseatException(String code, String message) {
        super(message);
        this.code = code;
    }

    public LetuseatException(String code, String message, Throwable throwable) {
        super(message, throwable);
        this.code = code;
    }

    public LetuseatException(ExceptionCodeEnum exception) {
        super(exception.getResDesc());
        this.code = exception.getResCode();
    }

}
